from rest_framework.viewsets import ModelViewSet
from rest_framework.permissions import IsAdminUser
from rest_framework.response import Response

from goods.models import SPUSpecification, SpecificationOption
from meiduo_admin.serializers.specs import SpecsSerializer


class GoodSpecsViewSet(ModelViewSet):
    """定义商品规格视图集"""
    permission_classes = [IsAdminUser]

    serializer_class = SpecsSerializer

    queryset = SPUSpecification.objects.all()

    # def Simple(self, request):
    #     # 规格简单展示
    #
    #     queryset = SpecificationOption.objects.all()
    #
    #     serializer = SimpleSerializer(queryset, many=True)
    #
    #     return Response(serializer.data)




